import base64

# 图片转base64字符串
def base64ToString(path):
    with open(path,"rb") as f:
        base64_data=base64.b64encode(f.read())
        print(base64_data)
        return base64_data

base64ToString("C://Users//Administrator//Pictures//微信截图_20210131065948.png")